Subject: Re: Hi
From: Gau <[email-masked]>
To: Formula One Licensew <[email-masked]>
Cc: [email-masked]
Date: Tue, 5 Dec 1995 16:57:32 -0800 (PST)

On Tue, 5 Dec 1995, Formula One Licensew wrote:

> a) Does anyone know a way of iconifying an Amos program?
>    i.e. Flip to Workbench and leave an icon on it that the user can double
>         click on to return to the Amos program. A lot to ask I know,
>         maybe a window type title bar with gadgets would work just as well?

Your AMOS program would have to create a message port.  Then you write a 
small program in either C or assembler that will send a message 
specificaly to the port created by the AMOS program.  When your AMOS 
program gets wind of the message, it simply does an Amos To Front to get 
the AMOS screen back.  Put the small program onto an icon and you've get 
it beat.  There's some fiddling necessary to get the object to show up on 
Workbench and I don't exactly know how you'd tell workbench to add the 
icon.  Icon library maybe?  Someone help me out here if they can.  Your 
AMOS program can use LoadSeg from the DOS library and Exec's CreateTask 
to get the message task to run under control from the main program and 
use KillTask and UnloadSeg to remove when your program finishes.
> 
> d) Does anyone have file format descriptions of Bmp,Jpeg,Pic and any other
>    picture file format? This is for the author of BlackBoard, he can't
>    use datatypes for one reason or another. I have found GIF,PCX & IFF
>    descriptions anybody got any others please?
>
Talk about intersting timing - I just hacked the BMP format for use on a 
486 project I'm doing.  Given a 256-color bitmap (ie: 8 bits/pixel), the 
format will be like this:

	struct BMP {
		char	"BM",
		ulong	filesize,
		ulong	0, 	      	/* ??? */
		ulong	GfxOffset,     	/* from start of file */
		ulong	PaletteOffset, 	/* from this location */
		ulong	width,	      	/* width of image  */
		ulong   height,	      	/* height of image */
		ushort	0,		/* ??? */
		ushort	bitsperpixel,	/* 8 */
		ulong	0,		/* ??? */
		ulong	bodysize,	/* size of image in bytes */
		ulong	fill[2]		/* ??? */
		ulong	palettesize	/* # colors in palette */
		ulong	ditto		/* ??? */
		ulong	palette[256]	/* palette information */
		byte	firstpixel	/* first pixel of image */
		...
	};

	Note: I don't know exactly what the palette ordering is,
	it's either rr gg bb 00, or bb gg rr 00, but I can't say for
	sure since I don't exactly know the VGA's ordering myself.
	I know that I get the right results if I use

	ubyte *foo;
	ulong pal;
	foo=(ubyte *)&pal;
	// assume an open file and fd is the descriptor...
	read(fd,foo,4)  // read four bytes from the palette of the BMP
	r=(*foo)>>2;
	g=(*(foo+1))>>2;
	b=(*(foo+2))>>2;
	_remappalette(colorfrom0to255,(r<<16)+(g<<8)+b);

	If 0x0000000000rrrrrr00gggggg00bbbbbb is the format of the
	VGA palette then I got it right the first time, if not, then
	I got red and blue backwards and the BMP is then using bb gg rr 00

Cheers,

==============================================================================
Gau of the Veldt

  "Draped in monster hides, eyes shining with intelligence.
   A youth surviving against all odds..."

===== Email: [email-masked] ====== WWW: http://www.netbistro.com/comp =====